package com.yuke.cloud.service.smc.dao;

import com.yuke.cloud.common.core.mybatis.MyMapper;
import com.yuke.cloud.service.api.smc.dto.GoodsAndSpecInfoDto;
import com.yuke.cloud.service.api.smc.dto.ShopCartInfoDto;
import com.yuke.cloud.service.api.smc.dto.ShopInfoDto;
import com.yuke.cloud.service.smc.dto.ShopDto;
import com.yuke.cloud.service.smc.dto.StoreShopDto;
import com.yuke.cloud.service.smc.entity.ExcelObject;
import com.yuke.cloud.service.smc.entity.Shop;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface ShopMapper extends MyMapper<Shop> {
    List<ShopDto> findShopBySearch(String search);
    List<ShopDto> findShopsBySpecIds(List<Long> specIds);
    List<ShopDto> findNearShops(@Param("longitude") BigDecimal longitude, @Param("latitude") BigDecimal latitude, @Param("distance") Integer deliverDistance);
    List<ShopDto> findNearShopsBySpecIds(@Param("list") List<Long> specIds, @Param("longitude") BigDecimal longitude, @Param("latitude") BigDecimal latitude, @Param("distance") Integer deliverDistance);
    List<ShopDto> findShopsBySpecIdsAndDis(@Param("list") List<Long> specIds, @Param("longitude") BigDecimal longitude, @Param("latitude") BigDecimal latitude);
    ShopDto getShopDtoByShopId(Long shopId);
    List<ShopDto> findByIds(List<Long> shopIds);
    List<Shop> getListDetailByCondition(@Param("shopDto") ShopDto shopDto);
    List<Shop> getListByCondition(@Param("shop") Shop shop);

    //api
    List<ShopCartInfoDto> getShopCartInfoDto(List<GoodsAndSpecInfoDto> goodsAndSpecInfoDtos);

    List<ShopInfoDto> getShopInfoByShopIds(@Param("list") List<Long> shopIds);

    List<ShopDto> findNearShopsAndReferenceShop(@Param("longitude") BigDecimal longitude, @Param("latitude") BigDecimal latitude,
                                                @Param("distance") Integer deliverDistance, @Param("referenceShopId") Long referenceShopId);

    List<ShopDto> findNearSelfShops(@Param("longitude") BigDecimal longitude, @Param("latitude") BigDecimal latitude,
                                    @Param("distance") Integer deliverDistance);
    List<ShopInfoDto> getShopIdsByCondition(@Param("shop") Shop shop);

    List<ShopInfoDto> getShopDtoByUserId(@Param("userId") Long userId);

    List<ShopInfoDto> getShopInfoByShopName(@Param("shopName")String shopName);

    List<ShopInfoDto> getShopInfoByGroupId(@Param("groupId") Long groupId);

    List<ShopInfoDto> getShopInfoDtoByUserIdList(@Param("userIds") List<Long> userIds);

    //List<OdsOrderApiDto> findCountMoney(OdsOrderApiDto orderShopDto);
    //
    //Integer findCountMoneyByShopId(OdsOrderApiDto orderShopDto2);

    ShopInfoDto getShopInfoByShopId(@Param("shopId")Long shopId);

    List<ShopInfoDto> getAllShopInfo();

    StoreShopDto findShopByStore(@Param("storeId") Long storeId);

    List<ShopInfoDto> findShopNameByShopIds(List<Long> list);

    List<ShopDto> findNearShopTeam(@Param("longitude") BigDecimal longitude, @Param("latitude") BigDecimal latitude, @Param("distance") Integer deliverDistance);

    List<ShopDto> findUsedShopTeam(@Param("userId") Long userId,@Param("shopId")Long shopId);

    /**
     *  加盟店铺
     * @return
     */
    List<ExcelObject> joinExcel();

    /**
     * 活跃店铺
     * @return
     */
    List<ExcelObject> activeShops();

}
